/**
 * 
 */
package br.com.locasis.entity.enums;


/**
 * @author rlresende
 *
 */
public enum TipoVeiculo {
	
	CARROS(0, "Automóvel"),
	CAMINHÃO(1, "Caminhão"),
	CAMINHONETE(2, "Caminhonete"),
	CAMIONETA(3, "Camioneta"),
	T4X4(4, "4x4"),
	MOTO(5, "Moto"),
	PICKUP(6, "Pick-up"),
	REBOQUE(7, "Reboque");
	
	private Integer value;
	private String description;

	private TipoVeiculo(Integer value, String description) {
		this.value = value;
		this.description = description;
	}

	public Integer getValue() {
		return this.value;
	}

	public String getDescription() {
		return this.description;
	}

	public static String getEnumDescription(Integer value) {
		for (TipoVeiculo currentEnum : values()) {
			if (currentEnum.getValue().equals(value)) {
				return currentEnum.getDescription();
			}
		}
		return null;
	}

	public static TipoVeiculo find(String roleName) {
		for (TipoVeiculo currentEnum : values()) {
			if (currentEnum.getValue().equals(roleName)) {
				return currentEnum;
			}
		}
		return null;
	}
	
	public static TipoVeiculo find(Integer value) {
		for (TipoVeiculo currentEnum : values()) {
			if (currentEnum.getValue().equals(value)) {
				return currentEnum;
			}
		}
		return null;
	}

}
